package tr.edu.metu.is550.isell.domain;

public enum AdType {

    RENTAL(0),
    SALE(1);

    private final Integer value;

    private AdType(Integer value) {
        this.value = value;
    }

    public Integer getValue() {
        return value;
    }

    public static AdType getByValue(Integer value) {
        if (value.equals(AdType.RENTAL.getValue()))
            return AdType.RENTAL;
        if (value.equals(AdType.SALE.getValue()))
            return AdType.SALE;

        throw new NotFoundException("AdType", value.toString());
    }


}
